<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/default.css" />

<script src="${pageContext.request.contextPath}/js/jquery-1.6.2.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.floatbox.10.4.min.js" type="text/javascript"></script>
<script language="JavaScript">

$(document).ready(function(){
	
	$("#Previous").click(function(){
	       
        $("#maintainusers_currentPage").val($("#maintainusers_currentPage").val()-1);
           
         $("form").submit();
      });
      
       $("#Next").click(function(){
 
        $("#maintainusers_currentPage").val(parseInt($("#maintainusers_currentPage").val())+1);
           
         $("form").submit();
      });
      
});
</script>
<script language="JavaScript">

$(document).ready(function(){
	$(".editNewsValue").click(function () {
	    $.floatbox({
	        ajax: {
	            url: "editNewsValue.action?newsValueId="+$(this).attr('id'),
	          //  params: "codeValueId="+$(this).attr('id'), //post parameters
	            before: "<p>Loading content</p>", //loading message while the request is being processed
	            finish: function () {
	               
	            }
	        },
	        fade: true
	    });
	});
});
</script>
<title>用户管理</title>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<s:form action="maintainusers" theme="simple">
	<s:hidden name="currentPage"></s:hidden>
	<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#336600">
    	<tr> 
      		<td width="100%" bgcolor="#669900"><strong><font color="#FFFFFF">用户管理</font></strong></td>
    	</tr>
    	<tr align="center" bgcolor="#F9F9F9"> 
      		<td>
      			<table height="0%" width="98%" cellspacing="1" cellpadding="3" border="0">
          			<tr>
          				<td colspan="7">
          					<table>
          						<tr>
			          				<td colspan="2" align="left">　 
						              	<input type="button" name="Submit22" value="添加用户" onClick="location='addUser.action';"> 
						            </td>
			            		</tr>
	            			</table>
	            		</td>
          			</tr>
		          	<tr bgcolor="#669900"> 
			            <td><font color="#FFFFFF"><strong>名称</strong></font></td>  
			             <td><font color="#FFFFFF"><strong>职位</strong></font></td>      
			            <td width="15%" align="center"><font color="#FFFFFF"><strong>操作</strong></font></td>
		          	</tr>
		          	<s:set name="num" value="0"></s:set>
		          	<s:iterator value="users">
	          			<tr bgcolor="#e7e7e7"> 
				            <td width="25%"><s:property value="name" /></td>
				            <td width="25%"><s:property value="position" /></td>				          				            
				            <td align="center" width="10%">
				            	<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/delenews.gif" /><a href='<s:url value="deleteUser.action"><s:param name="userId" value="id"/></s:url>' >删除</a>
				            	<img hspace="5" align="absmiddle" src="${pageContext.request.contextPath}/images/admin/setuser.gif" /><a href='<s:url value="editUser.action"><s:param name="userId" value="id"/></s:url>' >修改</a>
				            </td>
	          			</tr>
          			</s:iterator>
          		  	<tr> 
            			<td colspan="3" align="center"> <hr width="95%" style="color:#669900"></td>
          			</tr>
          			<tr>
          				<td class="page_style" colspan="7" align="right">
          					<span class="page-navi-count">
								<a href="#" id="Previous">&lt;&lt;Previous</a>
								<s:set var="currentPage" value="0" /> 
				  				<s:iterator value="%{pager.pageNums}">
									<a href="<s:url value='maintainusers.action'><s:param name='currentPage' value='%{#currentPage}'/></s:url>" id="pager">
										<s:property value="%{pager.pageNums[#currentPage]}" />
									</a>
									<s:set var="currentPage" value="%{#currentPage+1}" />
								</s:iterator> 
								<a href="#" id="Next">Next&gt;&gt;</a> 
							</span> 
          				</td>
          			</tr>
        		</table>
      		</td>
    	</tr>
  	</table>
</s:form>
</body>
</html>